package org.example.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.pojo.Tasks;
import org.example.utils.TasksResponseData;

import java.util.List;

/**
 * ClassName: TasksMapper
 * Description:
 *
 * @Author Kotaro
 * @Create 2024/11/26 17:08
 * @Version 1.0
 */
@Mapper
public interface TasksMapper {
    Integer selectTasksStatusByRequesterId(@Param("requesterId")String requesterId);

    Tasks selectTasksByTasksStatus(String taskStatus);

    Integer selectTasksStatusByReceiverId(String receiverId);

    int updateReceiverIdByTasksId(@Param("receiverId") String receiverId, @Param("taskId") Integer taskId);

    int addTask(Tasks tasks);

    int reviewTasksByTasksId(@Param("taskId")Integer taskId, @Param("rating")Integer rating, @Param("comment")String comment);

    int completeTasksByTasksId(Integer taskId);

    List<Tasks> showAllTasks();

    List<Tasks> showAllTasksByTaskCategory(@Param("taskCategory")Integer taskCategory);

    List<Tasks> showAllTasksByUserId(String userId);

    int recallTasksByTaskId(Integer taskId);

    List<TasksResponseData> selectTasksByRequesterId(String requesterId);

    List<Tasks> showAllTasksByStringAndInteger(@Param("userId")String userId,@Param("taskStatus") Integer taskStatus);

    int reviewTasksByTasksIdOne(
            @Param("taskId") Integer taskId,
            @Param("requesterId") Integer requesterId,
            @Param("rating") Integer rating,
            @Param("remark") String remark,
            @Param("comment") String comment
    );

}
